﻿<UserControl x:Class="Vibstudio.NetConfigurator.UI.Views.ToolbarView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <UserControl.Resources>
        <ResourceDictionary>

            <!-- SettingsMenu template -->
            <ControlTemplate x:Key="SettingsMenu"
                             TargetType="Button">
                <StackPanel x:Name="_settingsMenuPanel"
                            Background="Transparent"
                            Width="40">
                    <Button x:Name="_settingsButton"
                            Margin="0,0,0,10"
                            Template="{DynamicResource SettingsButton}" />
                    <StackPanel x:Name="_settingsPanel">
                        <Button Margin="0,0,0,10"
                                Template="{DynamicResource ApplicationsButton}" />
                        <Button Margin="0,0,0,10"
                                Template="{DynamicResource ConfigurationsButton}" />
                    </StackPanel>
                </StackPanel>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver"
                             SourceName="_settingsMenuPanel"
                             Value="False">
                        <Setter Property="Height"
                                Value="{Binding ElementName=_settingsButton, Path=ActualHeight}"
                                TargetName="_settingsMenuPanel" />
                    </Trigger>
                    <Trigger Property="IsMouseOver"
                             SourceName="_settingsButton"
                             Value="True">
                        <Setter Property="Visibility"
                                Value="Visible"
                                TargetName="_settingsPanel" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel Name="SettingsMenuPanel"
                Margin="8">
        <Button ClickMode="Release"
                Template="{StaticResource SettingsMenu}">
        </Button>
    </StackPanel>
</UserControl>
